﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExtAspNet;
using Manager;
using Model;
using System.Data;
namespace HealthSystem
{
    public partial class MyOrg : BasePage
    {
        HW_OrgManager manager = new HW_OrgManager();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGrid();
            }
        }
        public void BindGrid()
        {
            if (CustomerProfile.SchoolUser != null && CustomerProfile.SchoolUser.hw_School != null)
            {
                HW_Org list = manager.GetById(CustomerProfile.SchoolUser.hw_School.OrgCode);
                this.Gird1.DataSource = list;
                this.Gird1.DataBind();
            }  
        }
        public void Grid1_DoubleClick(object sender, ExtAspNet.GridRowClickEventArgs e)
        {
            int index = e.RowIndex;
            string pid = this.Gird1.Rows[index].DataKeys[1].ToString();
            PageContext.RegisterStartupScript(Window1.GetShowReference("SubAdmin.aspx?pid=" + pid, "区县镇管理员"));
        }
        public void Window1_Close(object sender, EventArgs e)
        {

        }
    }
}